package com.example.ziputil.controller;

import com.example.ziputil.service.ZipUtilService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;


@Controller
@RequestMapping("/zipUtil")
public class ZipUtilController {

    private static Logger logger = LoggerFactory.getLogger(ZipUtilController.class);

    @Resource
    private ZipUtilService zipUtilService;

    @GetMapping("/downloadZipFile")
    public void downloadZipFile(HttpServletRequest request, HttpServletResponse response) throws Exception {
        List<String> srcNameList = Arrays.asList("/2023年数据上报任务/1月数据上报任务/北京上报任务", "/2023年数据上报任务/2月数据上报任务", "/2023年数据上报任务/3月数据上报任务", "/任务111名字", "/任务1/任务1子任务", "/任务2/任务2子任务", "/23423424/温热我认为", "/3月报送任务/天津3月报送任务", "/242342/234234324242342", "/23434234/243234", "/测试001/测试001-01", "/2月报送任务/2月报送任务-1", "/234234/1231312312", "/false false false false/false 01", "/false false false false/false 02", "/ework升级测试/ework升级测试-1", "/ework升级测试/ework升级测试-2", "/Excel测试/32432423432", "/修改编辑", "/新增退回审核/新增退回审核子任务", "/新增退回审核2/新增退回审核2子任务", "/任务编辑/任务编辑子任务11", "/去玩儿推");
        zipUtilService.zipFile(srcNameList,request, response);
    }

}
